import os
import pickle
stock_info = {'code':'600000','name':'浦发银行','price':11.54}
with open('data/stockinfo.pkl', 'wb') as stock_file:
    pickle.dump(stock_info, stock_file) # 写文件
with open('data/stockinfo.pkl', 'rb') as stock_file:
    ret_read = pickle.load(stock_file) # 读文件   
    print(type(ret_read))
    print(ret_read)

